﻿
Public NotInheritable Class frmAbout

    Private Sub frmAbout_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        If IsTopMost = True Then
            frmmain.TopMost = IsTopMost
        End If
        Me.Close()
    End Sub

    Private Sub frmAbout_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Me.Dispose()
    End Sub


    Private Sub AboutBox1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' 设置此窗体的标题。
        Dim ApplicationTitle As String
        If My.Application.Info.Title <> "" Then
            ApplicationTitle = My.Application.Info.ProductName
        Else
            ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If
        Me.Text = String.Format("关于 {0}", ApplicationTitle)
        ' 初始化“关于”对话框显示的所有文字。
        ' TODO: 在项目的“应用程序”窗格中自定义此应用程序的程序集信息 
        '    属性对话框(在“项目”菜单下)。
        Me.LabelProductName.Text = My.Application.Info.Title
        Me.LabelVersion.Text = String.Format("版本 {0}", My.Application.Info.Version.ToString)
        Me.LabelCopyright.Text = My.Application.Info.Copyright
        Me.LabelCompanyName.Text = My.Application.Info.CompanyName
        Me.TextBoxDescription.Text = "更多登录：" & vbCrLf & _
                                      GoogleCode & vbCrLf & _
                                      swweb
        'Taobao & vbCrLf & _

        If IsReg = True Then
            Me.LinkLabel1.Text = "已注册 点击旺旺"
        Else
            Me.LinkLabel1.Text = "未注册 点击旺旺"
        End If

        Me.Location = New Point((Screen.PrimaryScreen.WorkingArea.Width - Me.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Bottom - Me.Height) / 2)
    End Sub

    Private Sub OKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OKButton.Click
        Me.Dispose()
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Try
            Process.Start(WW)
        Catch ex As Exception
            ' The error message
            'MessageBox.Show("Unable to open link that was clicked.")
        End Try
    End Sub

    Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
        'Dim LocalFolder As String
        'Dim LocalFile As String

        'Dim OldVer As String
        'Dim Url As String

        ''Dim Rel As Boolean

        'Me.Cursor = Cursors.WaitCursor
        ''Rel = GetEmail("likai14983", "yyz840101", "pop.163.com", "swtupdate")

        'OldVer = My.Application.Info.Version.ToString

        'LocalFolder = My.Application.Info.DirectoryPath
        'LocalFile = LocalFolder & "\SwTool.ini"

        'Dim Ini As New Ini
        'Url = ini.INIRead(LocalFile, "SwTool", "Url")
        'If Url = "" Then
        '    Url = UpdateiniUrl
        'End If

        'If IsFileExsts(LocalFolder & "\simpleupdater.exe") Then
        '    Process.Start(LocalFolder & "\simpleupdater.exe", "-option=copyself  -ver=" & OldVer & " -url=" & Url & " -local=" & LocalFolder & " -start=swtool.exe", "", Nothing, "")
        'Else
        '    MsgBox("升级程序错误，转到googlecode + 百度盘 下载...", MsgBoxStyle.Information)
        '    Process.Start(GoogleCode)
        Process.Start(BaiDuPan)
        'End If
        'Me.Cursor = Cursors.Default
        'If Rel = True Then
        '    MsgBox("SwTool更新完成，下次运行时更新文件。", MsgBoxStyle.Information, "更新")
        'Else
        '    MsgBox("已是最新版或者网络错误，请重试。", MsgBoxStyle.Information, "更新")
        'End If
    End Sub
End Class
